#include "UpgmaCluster.h"
#include <iostream>

using namespace std;

//prints the upgma tree in newick format
void PrintTree(UpgmaCluster* root, ostream& out){

	if(root->left == NULL && root->right == NULL){
		out << root->sequences[0] ;
		return;
	}

	out << "(";
	PrintTree(root->left, out);
	out << ",";
	PrintTree(root->right, out);
	out << ")" << ":" << root->height;
}


//returns number of nodes in a tree
int nodecount(UpgmaCluster* root){
	if (root == NULL)
		return 0;

	return 1 + nodecount(root->left) + nodecount(root->right);
}
